<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>社交活动平台 - 通知设置</title>
    <style>
        /* 重置样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        /* 容器样式 */
        .container {
            max-width: 480px;
            margin: 0 auto;
            background-color: #fff;
            min-height: 100vh;
        }

        /* 头部导航 */
        .header {
            position: sticky;
            top: 0;
            background-color: white;
            padding: 16px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            z-index: 100;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .back-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #333;
        }

        .header-title {
            font-size: 18px;
            font-weight: bold;
            flex-grow: 1;
            text-align: center;
        }

        .action-btn {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #333;
        }

        /* 通知设置头部 */
        .notifications-header {
            padding: 24px 16px;
            text-align: center;
            background: linear-gradient(135deg, #45b7d1 0%, #2c8cb9 100%);
            color: white;
        }

        .notifications-title {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .notifications-description {
            font-size: 14px;
            opacity: 0.9;
        }

        /* 设置菜单 */
        .settings-menu {
            padding: 16px 0;
        }

        /* 设置项 */
        .setting-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid #eee;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .setting-item:hover {
            background-color: #f9f9f9;
        }

        .setting-icon {
            width: 24px;
            height: 24px;
            margin-right: 16px;
            color: #45b7d1;
        }

        .setting-content {
            flex-grow: 1;
        }

        .setting-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .setting-description {
            font-size: 13px;
            color: #999;
        }

        .setting-time {
            font-size: 12px;
            color: #666;
        }

        .switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 28px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 28px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked + .slider {
            background-color: #45b7d1;
        }

        input:checked + .slider:before {
            transform: translateX(22px);
        }

        /* 通知类型分组 */
        .section-title {
            padding: 16px 20px;
            font-size: 14px;
            color: #999;
            text-transform: uppercase;
            letter-spacing: 1px;
            border-bottom: 1px solid #eee;
        }

        /* 静音时段设置 */
        .quiet-hours {
            padding: 16px 20px;
            background-color: #f9f9f9;
            border-bottom: 1px solid #eee;
        }

        .quiet-hours-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 12px;
        }

        .quiet-hours-description {
            font-size: 14px;
            color: #666;
            margin-bottom: 16px;
        }

        .quiet-hours-range {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .time-input {
            flex-grow: 1;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid #ddd;
            font-size: 14px;
        }

        .time-separator {
            color: #999;
        }

        /* 通知预览 */
        .notification-preview {
            padding: 16px 20px;
            border-bottom: 1px solid #eee;
        }

        .preview-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 12px;
        }

        .preview-content {
            background-color: #f0f8ff;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 12px;
        }

        .preview-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
        }

        .preview-icon {
            font-size: 20px;
        }

        .preview-title-text {
            font-weight: bold;
            color: #333;
        }

        .preview-time {
            font-size: 12px;
            color: #999;
        }

        .preview-message {
            font-size: 14px;
            color: #666;
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            padding: 12px 0;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #9e9e9e;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-item.active {
            color: #ff6b35;
        }

        .nav-icon {
            font-size: 20px;
            margin-bottom: 4px;
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 40px 20px;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #ff6b35;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            border-radius: 16px;
            width: 85%;
            max-width: 320px;
            padding: 24px;
            text-align: center;
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.3s ease;
        }

        .modal.show {
            transform: translateY(0);
            opacity: 1;
        }

        .modal-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        .modal-message {
            margin-bottom: 24px;
            color: #666;
            line-height: 1.6;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .cancel-btn {
            background-color: #f5f5f5;
            color: #666;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        /* 响应式适配 */
        @media (max-width: 480px) {
            .header-content {
                padding-top: 4px;
            }
            
            .setting-item {
                padding: 16px 16px;
            }
        }

        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .setting-item {
            animation: fadeInUp 0.6s ease forwards;
        }

        /* 图标样式 */
        .icon-message { color: #45b7d1; }
        .icon-activity { color: #ff6b35; }
        .icon-system { color: #9c27b0; }
        .icon-reminder { color: #4caf50; }
        .icon-group { color: #ff9800; }

        /* 通知类型标签 */
        .notification-tag {
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 10px;
            font-weight: bold;
            margin-left: 8px;
        }

        .tag-message { background-color: #e3f2fd; color: #1976d2; }
        .tag-activity { background-color: #ffebee; color: #e53935; }
        .tag-system { background-color: #f3e5f5; color: #7b1fa2; }
        .tag-reminder { background-color: #e8f5e9; color: #388e3c; }
        .tag-group { background-color: #fff8e1; color: #ff8f00; }

        /* 静音时段指示器 */
        .quiet-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 4px;
        }

        .quiet-dot {
            width: 8px;
            height: 8px;
            background-color: #ff9800;
            border-radius: 50%;
        }

        .quiet-text {
            font-size: 12px;
            color: #ff9800;
        }

        /* 空状态 */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
        }

        .empty-icon {
            font-size: 48px;
            margin-bottom: 20px;
            color: #ccc;
        }

        .empty-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 12px;
            color: #666;
        }

        .empty-description {
            color: #999;
            margin-bottom: 24px;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部导航 -->
        <header class="header">
            <div class="header-content">
                <button class="back-btn" id="backBtn">←</button>
                <div class="header-title">通知设置</div>
                <button class="action-btn" id="saveBtn">保存</button>
            </div>
        </header>

        <!-- 通知设置头部 -->
        <div class="notifications-header">
            <h1 class="notifications-title">通知管理</h1>
            <p class="notifications-description">自定义您的通知偏好，不错过重要信息</p>
        </div>

        <!-- 设置菜单 -->
        <div class="settings-menu">
            <!-- 消息通知分组 -->
            <div class="section-title">消息通知</div>
            
            <!-- 消息提醒 -->
            <div class="setting-item" id="messageNotification">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-message">💬</span>
                    <div class="setting-content">
                        <div class="setting-title">消息提醒</div>
                        <div class="setting-description">接收私信、评论等互动消息通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 活动回复 -->
            <div class="setting-item" id="activityReply">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-message">💬</span>
                    <div class="setting-content">
                        <div class="setting-title">活动回复</div>
                        <div class="setting-description">当您发起的活动有新回复时通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 好友动态 -->
            <div class="setting-item" id="friendActivity">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-message">👥</span>
                    <div class="setting-content">
                        <div class="setting-title">好友动态</div>
                        <div class="setting-description">好友发布活动或参与活动时通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 系统通知分组 -->
            <div class="section-title">系统通知</div>
            
            <!-- 系统公告 -->
            <div class="setting-item" id="systemAnnouncement">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-system">📢</span>
                    <div class="setting-content">
                        <div class="setting-title">系统公告</div>
                        <div class="setting-description">平台重要更新和公告通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 活动提醒分组 -->
            <div class="section-title">活动提醒</div>
            
            <!-- 活动开始提醒 -->
            <div class="setting-item" id="activityStart">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-reminder">⏰</span>
                    <div class="setting-content">
                        <div class="setting-title">活动开始提醒</div>
                        <div class="setting-description">活动开始前30分钟提醒您参与</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 活动报名确认 -->
            <div class="setting-item" id="activityConfirmation">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-activity">📅</span>
                    <div class="setting-content">
                        <div class="setting-title">活动报名确认</div>
                        <div class="setting-description">报名成功或被拒绝时通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 活动变更提醒 -->
            <div class="setting-item" id="activityChange">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-activity">🔄</span>
                    <div class="setting-content">
                        <div class="setting-title">活动变更提醒</div>
                        <div class="setting-description">活动时间、地点等信息修改时通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 社交互动分组 -->
            <div class="section-title">社交互动</div>
            
            <!-- 点赞通知 -->
            <div class="setting-item" id="likeNotification">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-message">👍</span>
                    <div class="setting-content">
                        <div class="setting-title">点赞通知</div>
                        <div class="setting-description">活动或评论被点赞时通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 评论通知 -->
            <div class="setting-item" id="commentNotification">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-message">💬</span>
                    <div class="setting-content">
                        <div class="setting-title">评论通知</div>
                        <div class="setting-description">活动或帖子有新评论时通知</div>
                    </div>
                </div>
                <label class="switch">
                    <input type="checkbox" checked>
                    <span class="slider"></span>
                </label>
            </div>

            <!-- 静音时段设置 -->
            <div class="quiet-hours">
                <h3 class="quiet-hours-title">静音时段</h3>
                <p class="quiet-hours-description">在此时间段内不接收任何通知，保持专注</p>
                
                <div class="quiet-hours-range">
                    <input type="time" class="time-input" id="startHour" value="22:00">
                    <span class="time-separator">至</span>
                    <input type="time" class="time-input" id="endHour" value="08:00">
                </div>
                
                <div class="quiet-indicator">
                    <span class="quiet-dot"></span>
                    <span class="quiet-text">当前设置：22:00 - 08:00</span>
                </div>
            </div>

            <!-- 通知预览 -->
            <div class="notification-preview">
                <h3 class="preview-title">通知预览</h3>
                <div class="preview-content">
                    <div class="preview-header">
                        <span class="preview-icon">📅</span>
                        <div>
                            <div class="preview-title-text">活动提醒</div>
                            <div class="preview-time">刚刚</div>
                        </div>
                    </div>
                    <p class="preview-message">您报名的"周末户外徒步活动"将在30分钟后开始，请准时参加！</p>
                </div>
            </div>

            <!-- 通知偏好设置 -->
            <div class="setting-item" id="notificationPreferences">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-group">⚙️</span>
                    <div class="setting-content">
                        <div class="setting-title">通知偏好设置</div>
                        <div class="setting-description">自定义不同类型的通知显示方式</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 通知声音设置 -->
            <div class="setting-item" id="notificationSound">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-group">🎵</span>
                    <div class="setting-content">
                        <div class="setting-title">通知声音</div>
                        <div class="setting-description">选择不同的通知提示音</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 通知显示设置 -->
            <div class="setting-item" id="notificationDisplay">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-group">👁️</span>
                    <div class="setting-content">
                        <div class="setting-title">通知显示</div>
                        <div class="setting-description">选择是否在锁屏和通知中心显示</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 通知清空 -->
            <div class="setting-item" id="clearNotifications">
                <div style="display: flex; align-items: center;">
                    <span class="setting-icon icon-group">🗑️</span>
                    <div class="setting-content">
                        <div class="setting-title">清空通知</div>
                        <div class="setting-description">清除所有已读和未读的通知记录</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 底部导航 -->
        <nav class="bottom-nav">
            <div class="nav-item" data-page="home">
                <span class="nav-icon">🏠</span>
                <span>首页</span>
            </div>
            <div class="nav-item" data-page="search">
                <span class="nav-icon">🔍</span>
                <span>搜索</span>
            </div>
            <div class="nav-item" data-page="publish">
                <span class="nav-icon">➕</span>
                <span>发布</span>
            </div>
            <div class="nav-item active" data-page="profile">
                <span class="nav-icon">👤</span>
                <span>我的</span>
            </div>
        </nav>

        <!-- 加载状态 -->
        <div class="loading" id="loadingIndicator">
            <div class="spinner"></div>
            <p>加载通知设置...</p>
        </div>

        <!-- 通知 Toast -->
        <div id="toast" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #4caf50; color: white; padding: 12px 24px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1001;"></div>
    </div>

    <script>
        // 全局变量
        let notificationSettings = {
            messageNotification: true,
            activityReply: true,
            friendActivity: true,
            systemAnnouncement: true,
            activityStart: true,
            activityConfirmation: true,
            activityChange: true,
            likeNotification: true,
            commentNotification: true
        };

        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            initEventListeners();
            simulateLoading();
            
            // 模拟加载通知设置
            setTimeout(() => {
                updateSettingsDisplay();
                hideLoading();
            }, 1500);
        });

        // 初始化事件监听器
        function initEventListeners() {
            // 返回按钮
            document.getElementById('backBtn').addEventListener('click', function() {
                window.history.back();
            });

            // 保存按钮
            document.getElementById('saveBtn').addEventListener('click', function() {
                showSuccessToast('通知设置已保存');
            });

            // 底部导航切换
            const navItems = document.querySelectorAll('.nav-item');
            navItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有激活状态
                    navItems.forEach(i => i.classList.remove('active'));
                    // 添加当前激活状态
                    this.classList.add('active');
                    
                    const page = this.dataset.page;
                    handleNavigation(page);
                });
            });

            // 设置项点击事件
            const settingItems = document.querySelectorAll('.setting-item');
            settingItems.forEach(item => {
                item.addEventListener('click', function() {
                    const settingId = this.id;
                    handleSettingClick(settingId);
                });
            });

            // 开关切换事件
            const switches = document.querySelectorAll('.switch input');
            switches.forEach(switchEl => {
                switchEl.addEventListener('change', function() {
                    const settingId = this.closest('.setting-item').id;
                    handleSwitchChange(settingId, this.checked);
                });
            });

            // 时间输入事件
            const timeInputs = document.querySelectorAll('.time-input');
            timeInputs.forEach(input => {
                input.addEventListener('change', function() {
                    showSuccessToast(`静音时段已更新为：${document.getElementById('startHour').value} - ${document.getElementById('endHour').value}`);
                });
            });

            // 模拟设置数据更新
            setInterval(() => {
                updateSettingsDisplay();
            }, 30000); // 每30秒更新一次
        }

        // 处理设置项点击
        function handleSettingClick(settingId) {
            switch(settingId) {
                case 'notificationPreferences':
                    alert('跳转到通知偏好设置页面');
                    break;
                case 'notificationSound':
                    alert('跳转到通知声音设置页面');
                    break;
                case 'notificationDisplay':
                    alert('跳转到通知显示设置页面');
                    break;
                case 'clearNotifications':
                    showClearNotificationModal();
                    break;
            }
        }

        // 处理开关切换
        function handleSwitchChange(settingId, isChecked) {
            switch(settingId) {
                case 'messageNotification':
                    notificationSettings.messageNotification = isChecked;
                    break;
                case 'activityReply':
                    notificationSettings.activityReply = isChecked;
                    break;
                case 'friendActivity':
                    notificationSettings.friendActivity = isChecked;
                    break;
                case 'systemAnnouncement':
                    notificationSettings.systemAnnouncement = isChecked;
                    break;
                case 'activityStart':
                    notificationSettings.activityStart = isChecked;
                    break;
                case 'activityConfirmation':
                    notificationSettings.activityConfirmation = isChecked;
                    break;
                case 'activityChange':
                    notificationSettings.activityChange = isChecked;
                    break;
                case 'likeNotification':
                    notificationSettings.likeNotification = isChecked;
                    break;
                case 'commentNotification':
                    notificationSettings.commentNotification = isChecked;
                    break;
            }
            
            // 显示反馈
            const settingTitle = document.getElementById(settingId).querySelector('.setting-title').textContent;
            showSuccessToast(`${settingTitle} ${isChecked ? '已开启' : '已关闭'}`);
        }

        // 更新设置显示状态
        function updateSettingsDisplay() {
            const switches = document.querySelectorAll('.switch input');
            
            switches.forEach(switchEl => {
                const parentItem = switchEl.closest('.setting-item');
                const settingId = parentItem.id;
                
                // 根据数据更新开关状态
                switch(settingId) {
                    case 'messageNotification':
                        switchEl.checked = notificationSettings.messageNotification;
                        break;
                    case 'activityReply':
                        switchEl.checked = notificationSettings.activityReply;
                        break;
                    case 'friendActivity':
                        switchEl.checked = notificationSettings.friendActivity;
                        break;
                    case 'systemAnnouncement':
                        switchEl.checked = notificationSettings.systemAnnouncement;
                        break;
                    case 'activityStart':
                        switchEl.checked = notificationSettings.activityStart;
                        break;
                    case 'activityConfirmation':
                        switchEl.checked = notificationSettings.activityConfirmation;
                        break;
                    case 'activityChange':
                        switchEl.checked = notificationSettings.activityChange;
                        break;
                    case 'likeNotification':
                        switchEl.checked = notificationSettings.likeNotification;
                        break;
                    case 'commentNotification':
                        switchEl.checked = notificationSettings.commentNotification;
                        break;
                }
            });
        }

        // 显示清空通知确认弹窗
        function showClearNotificationModal() {
            const modal = document.createElement('div');
            modal.className = 'modal';
            modal.innerHTML = `
                <div class="modal-content">
                    <h3 class="modal-title">清空通知</h3>
                    <p class="modal-message">
                        确定要清空所有通知记录吗？<br>
                        此操作不可撤销。
                    </p>
                    <div class="modal-actions">
                        <button class="modal-btn cancel-btn" id="cancelClearBtn">取消</button>
                        <button class="modal-btn confirm-btn" id="confirmClearBtn">清空</button>
                    </div>
                </div>
            `;
            
            document.body.appendChild(modal);
            
            // 添加事件监听器
            modal.querySelector('#confirmClearBtn').addEventListener('click', function() {
                showSuccessToast('通知记录已清空');
                modal.remove();
            });
            
            modal.querySelector('#cancelClearBtn').addEventListener('click', function() {
                modal.remove();
            });
            
            // 点击背景关闭
            modal.addEventListener('click', function(e) {
                if (e.target === this) {
                    modal.remove();
                }
            });
            
            // 显示弹窗
            modal.classList.add('show');
        }

        // 处理导航切换
        function handleNavigation(page) {
            switch(page) {
                case 'home':
                    alert('跳转到首页');
                    break;
                case 'search':
                    alert('跳转到搜索页面');
                    break;
                case 'publish':
                    alert('跳转到发布页面');
                    break;
                case 'profile':
                    // 个人中心无需特殊处理
                    break;
            }
        }

        // 显示加载状态
        function showLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'block';
        }

        // 隐藏加载状态
        function hideLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'none';
        }

        // 模拟加载效果
        function simulateLoading() {
            showLoading();
            setTimeout(() => {
                hideLoading();
            }, 1500);
        }

        // 显示成功提示
        function showSuccessToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.style.display = 'block';
            
            // 3秒后自动隐藏
            setTimeout(() => {
                toast.style.display = 'none';
            }, 3000);
        }

        // 添加触摸反馈效果
        const buttons = document.querySelectorAll('button, .switch');
        buttons.forEach(button => {
            button.addEventListener('touchstart', function() {
                this.style.transform = 'scale(0.95)';
            });
            
            button.addEventListener('touchend', function() {
                this.style.transform = 'scale(1)';
            });
        });

        // 添加页面滚动效果
        let lastScrollTop = 0;
        window.addEventListener('scroll', function() {
            const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
            
            // 隐藏/显示底部导航
            const bottomNav = document.querySelector('.bottom-nav');
            if (scrollTop > lastScrollTop && scrollTop > 100) {
                bottomNav.style.transform = 'translateY(100%)';
            } else {
                bottomNav.style.transform = 'translateY(0)';
            }
            
            lastScrollTop = scrollTop;
        });

        // 添加返回顶部功能
        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                // 可以添加返回顶部按钮
            }
        });
    </script>
</body>
</html>
